home *** CD-ROM | disk | FTP | other *** search
/ Aminet 33 / Aminet 33 - October 1999.iso / Aminet / util / time / backclock.lha / backclock / sources / style / menu.c < prev    next >
Encoding:
C/C++ Source or Header  |  1999-07-14  |  797 b   |  36 lines

  1. #include <intuition/intuition.h>
  2. #include <libraries/pm.h>
  3. #include <proto/pm.h>
  4.  
  5. #include "menu.h"
  6.  
  7. extern struct PopupMenuBase  *PopupMenuBase;
  8.  
  9. ULONG OpenMenu(struct Window * win, UWORD code) {
  10.   struct PopupMenu *p;
  11.   ULONG result ;
  12.   /* initalize the menu
  13.    */
  14.   p=PMMenu("Clock Designer"),
  15.       PMItem("Remove this point"),
  16.         PM_UserData, ID_MDELETE,
  17.       PMEnd,
  18.       PMItem("Make this point be active"),
  19.         PM_UserData, ID_MBECURRENT,
  20.       PMEnd,
  21.       PMItem("Quit"),
  22.         PM_UserData, ID_MQUIT,
  23.       PMEnd,
  24.     End;
  25.  
  26.   if (p) {
  27.     /* open the menu
  28.      */
  29.     result = PM_OpenPopupMenu(win, PM_Menu, p,
  30.                                    PM_Code, code, TAG_DONE) ;
  31.     PM_FreePopupMenu(p) ;
  32.   }else
  33.     printf("Can't create the popup menu.\n") ;
  34.   return(result) ;
  35. }
  36.